﻿<Window x:Class="wpf4gp.Views.ExceptionDetailsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:local="clr-namespace:wpf4gp.Properties" 
        xmlns:helpers="clr-namespace:wpf4gp.Helpers"
        xmlns:vm="clr-namespace:wpf4gp.ViewModels"
        xmlns:dc="clr-namespace:wpf4gp.Dependencies"
        dc:DialogCloser.DialogResult="{Binding DialogResult}"
        WindowStartupLocation="CenterOwner"
        Width="800" Height="600"
        Title="{x:Static local:Resources.ExceptionWindow_Title}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition Height="100*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300" />
            <ColumnDefinition Width="435*" />
        </Grid.ColumnDefinitions>
        <!-- Menu -->
        <Menu Grid.ColumnSpan="2" VerticalContentAlignment="Center" VerticalAlignment="Center"
              Background="Transparent">
            <MenuItem Header="File">
                <MenuItem Header="{x:Static local:Resources.ExceptionWindow_CopyToClipboard}"
                          Command="{Binding Path=CopyToClipboardCommand}" />
                <Separator />
                <MenuItem Header="{x:Static local:Resources.ExceptionWindow_Close}"
                          Command="{Binding Path=CloseCommand}"/>
            </MenuItem>
        </Menu>
        <!-- Details -->
        <TreeView Grid.Row="1" ItemsSource="{Binding Details}" Margin="5"
                  helpers:TreeViewHelper.TreeViewSelectedItem="{Binding Path=SelectedNode, Mode=TwoWay}" >
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Children}" 
                                          DataType="{x:Type vm:ExceptionNode}">
                    <TextBlock Text="{Binding Path=Name}" />
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
        <GridSplitter Width="2" Grid.Row="1" Grid.RowSpan="1" />
        <TextBox Grid.Row="1" Grid.Column="1" 
                     VerticalAlignment="Stretch" VerticalContentAlignment="Top"
                     Margin="5" IsReadOnly="True" TextWrapping="Wrap"
                     Text="{Binding Path=SelectedNode, Mode=OneWay}" />
    </Grid>
</Window>
